<%@page pageEncoding = "utf-8" contentType = "text/html;charset=utf-8"%>

<%@taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt"%>


<h2><fmt:message key = "form.addeditOrganization"/></h2>

<div class = "messages"><jsp:include page = "/messages.jsp"/></div>

<form action = "adminui" method = "post" name = "organizationAddEditForm">
<div id="box">
   <table class = "form">      
      <tr>
         <td class = "label"><fmt:message key = "organization.shorttitle"/><span class="star">*</span></td>
         <td>
         	  <input name = "shorttitle" type = "text" maxlength="50" value = '<c:out value = "${organizationBean.shortTitle}"/>'>
         	  <span class="error"><c:out value="${error.shortTitle}"/></span>
         </td>         
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.fulltitle"/><span class="star">*</span></td>
         <td>
         	  <input name = "fulltitle" type = "text" maxlength="100" value = '<c:out value = "${organizationBean.fullTitle}"/>'>
         	  <span class="error"><c:out value="${error.fullTitle}"/></span>
         </td>         
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.postaladdress"/></td>
         <td><input name = "postaladdress" type = "text" maxlength="100" value = '<c:out value = "${organizationBean.postalAddress}"/>'></td>         
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.kpp"/></td>
         <td>
         	  <input id="kpp" name = "kpp" type = "text" maxlength="9" value = '<c:out value = "${organizationBean.kpp}"/>'>
         	  <span class="error"><c:out value="${error.kpp}"/></span>
         </td>         
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.inn"/></td>
         <td>
         	  <input id="inn" name = "inn" type = "text" maxlength="12" value = '<c:out value = "${organizationBean.inn}"/>'>
         	  <span class="error"><c:out value="${error.inn}"/></span>
         </td>        
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.settlementaccount"/></td>
         <td>
         	  <input id="account1" name = "settlementaccount" type = "text" maxlength="20" value = '<c:out value = "${organizationBean.settlementAccount}"/>'>
         	  <span class="error"><c:out value="${error.settlementAccount}"/></span>
         </td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.banktitle"/></td>
         <td><input name = "banktitle" type = "text" maxlength="100" value = '<c:out value = "${organizationBean.bankTitle}"/>'></td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.corraccount"/></td>
         <td>
         	  <input id="account2" name = "corraccount" type = "text" maxlength="20" value = '<c:out value = "${organizationBean.corrAccount}"/>'>
         	  <span class="error"><c:out value="${error.corrAccount}"/></span>	
         </td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.bik"/></td>
         <td>
         	  <input id="bik" name = "bik" type = "text" maxlength="9" value = '<c:out value = "${organizationBean.bik}"/>'>
         	  <span class="error"><c:out value="${error.bik}"/></span>	
         </td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.tel1"/></td>
         <td><input name = "tel1" type = "text" maxlength="20" value = '<c:out value = "${organizationBean.tel1}"/>'></td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.tel2"/></td>
         <td><input name = "tel2" type = "text" maxlength="20" value = '<c:out value = "${organizationBean.tel2}"/>'></td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.fax"/></td>
         <td><input name = "fax" type = "text" maxlength="20" value = '<c:out value = "${organizationBean.fax}"/>'></td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.email1"/><span class="star">*</span></td>
         <td>
         	  <input id="email1" name = "email1" type = "text" maxlength="50" value = '<c:out value = "${organizationBean.email1}"/>'>
         	  <span class="error"><c:out value="${error.email1}"/></span>
         </td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.email2"/></td>
         <td>
         	  <input id="email2" name = "email2" type = "text" maxlength="50" value = '<c:out value = "${organizationBean.email2}"/>'>
         	  <span class="error"><c:out value="${error.email2}"/></span>
         </td>
      </tr>
      
      <tr>
         <td class = "label"><fmt:message key = "organization.www"/></td>
         <td><input name = "www" type = "text" maxlength="50" value = '<c:out value = "${organizationBean.www}"/>'></td>
      </tr>
         
      <tr>
         <td class = "label"><fmt:message key = "organization.businesstype"/></td>
         <td><input name = "businesstype" type = "text" maxlength="250" value = '<c:out value = "${organizationBean.businessType}"/>'></td>
      </tr>   

      <tr>
         <td class = "label"><fmt:message key = "organization.notes"/></td>
         <td><textarea name = "notes" rows="10" cols="50"><c:out value = "${organizationBean.notes}"/></textarea></td>
      </tr>     
   </table>
</div>   
   
<input name = "id" type = "hidden" value="${organizationBean.id}">   
<input name = "_action" type = "hidden" value="processOrganizationForm">

<p>
   <span class="small">Обязательные для заполнения поля отмечены</span><span class="star">*</span>
</p>

<p>
<input type="submit" value='<fmt:message key = "Command.save"/>'>
или
<a href = "adminui?_action=organizationsList">
  <fmt:message key = "Command.cancel"/>
</a>                                  
</p>         

</form>